package com.lmds.sprindemo1.mq;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.config.JmsListenerContainerFactory;
import org.springframework.jms.config.SimpleJmsListenerContainerFactory;

import javax.jms.ConnectionFactory;

/**
 * Created with IntelliJ IDEA.
 * User: mgm
 * Date: 2019-08-22
 * Time: 11:20
 */

@Configuration
public class MqConfig {
    @Bean
    public JmsListenerContainerFactory<?> topicContainerFactory(ConnectionFactory factory){
        SimpleJmsListenerContainerFactory sjf = new SimpleJmsListenerContainerFactory();
        sjf.setConnectionFactory(factory);
        sjf.setPubSubDomain(true);
        return sjf;
    }

}
